package com.booksystem.campuslibrarymanagementsystem.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.booksystem.campuslibrarymanagementsystem.commen.request.userquest.BookBorrowrequst.Approval;
import com.booksystem.campuslibrarymanagementsystem.commen.result.userresuilt.ApprovalList;
import com.booksystem.campuslibrarymanagementsystem.entity.BooksTable;
import com.booksystem.campuslibrarymanagementsystem.entity.BorrowApprovalsTable;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.List;

public interface BorrowApprovalsTableService extends IService<BorrowApprovalsTable>{
    Approval queryid(int bookid);

    int updatebook (Approval book);

    List<BorrowApprovalsTable> existsByAccountAndBookidi(String account, int bookid);
    boolean save(BorrowApprovalsTable hh);

    List<ApprovalList> returnliststatus(String account, String approvalstate);

    List<ApprovalList> selectByaccount(@Param("account") String account);
    int deleteByAccountAndBookid(@Param("account") String account, @Param("recordid") int recordid);
     BooksTable aaa(int bookid);

    void unapproval(@Param("account") String account, @Param("approvalTime") LocalDate approvalTime ,
                    @Param("bookid") String bookid,
     @Param("Approvalstate")String Approvalstate);

    void onapproval(@Param("account") String account,
                    @Param("approvalTime") LocalDate approvalTime ,
                    @Param("bookid") String bookid,
                    @Param("Approvalstate")String Approvalstate
    );
    //通过账户id查询借阅记录，获得该账户借阅记录
    List<BorrowApprovalsTable> queryByAccount(String account);

    String querytime(int bookid , String account);

    List<BorrowApprovalsTable> querydislist(String approvalstate);


    List<BorrowApprovalsTable> getByApprovalState(String approvalstate);

}
